<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title th:text="${title}"></title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/static/css/me.css}">
    <link rel="stylesheet" href="../static/css/animate.min.css" th:href="@{/static/css/animate.min.css}">
    <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/static/css/typo.css}">
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/static/lib/prism/prism.css}">
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/static/lib/tocbot/tocbot.css}">
</head>
<body>

<nav th:fragment="menu(index)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary menu stackable">
            <h2 class="ui teal header item">AgoBlog</h2>
            <a href="#" th:href="@{/}"  class="m-item item m-mobile-hide" th:classappend="${index} == 1 ? 'active': '' "><i class="home icon" ></i>首页</a>
            <a href="#" th:href="@{/type/-1}"  class="m-item item m-mobile-hide" th:classappend="${index} == 2 ? 'active': '' "><i class="idea icon"></i>分类</a>
            <a href="#" th:href="@{/tag/-1}" class="m-item item m-mobile-hide" th:classappend="${index} == 3 ? 'active': '' "><i class="tags icon"></i>标签</a>
            <a href="#" th:href="@{/archives}" class="m-item item m-mobile-hide" th:classappend="${index} == 4 ? 'active': '' "><i class="clone icon"></i>归档</a>
            <div class="right item m-item m-mobile-hide">
                <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                    <div class="ui icon input transparent inverted input m-margin-tb-tiny">
                        <input type="text" name="search" placeholder="Search..." th:value="${search}">
                        <i onclick="document.forms['search'].submit()"  class="search icon link"></i>
                    </div>
                </form>
            </div>
        </div>

        <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
            <i class="sidebar icon"></i>
        </a>
    </div>


</nav>

<footer th:fragment="footer" class="ui inverted segment vertical m-padded-tb-massive">
    <div class="ui center aligned container">
        <!--divided分割线  center+aligned居中对齐-->
        <div class="ui grid divided inverted stackable">
            <!--three表示分3个 wide表示填满 column表示列-->
            <div class="three wide column">
                <div class="item">
                    <img  th:src="@{/static/images/wechat.png}" class="ui rounded" alt="" style="width: 110px">
                </div>
            </div>
                <div id="newblog-container" class="three wide column" th:fragment="newBlogList">
                    <h4 class="ui inverted header m-opacity-mini">最新博客</h4>
                    <div class="ui link list inverted m-text-lined m-text-thin m-text-spaced m-opacity-mini">
                        <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" th:text="${blog.title}" class="item" th:each="blog : ${newblogs}">用户故事 (User story)</a>
                        <!--/*-->
                        <a href="#" class="item">关于刻意练习的清单</a>
                        <a href="#" class="item">失败要趁早</a>
                        <!--*/-->
                    </div>
                </div>


            <div class="four wide column m-text-lined">
                <h4 class="ui inverted header m-opacity-mini">联系我</h4>
                <div class="ui link list inverted m-text-lined m-text-thin m-text-spaced m-opacity-mini">
                    <a href="#" class="item">Email: 954752598@qq.com</a>
                    <a href="#" class="item">QQ: 954752598</a>
                </div>
            </div>
            <div class="six wide column">
                <h4 class="ui inverted header m-opacity-mini">Ago</h4>
                <div class="ui link list inverted m-text-lined m-text-spaced m-opacity-mini m-text-thin">
                    <p class="item   ">这是我的个人博客，分享关于我的学习记录和生活日常</p>
                </div>
            </div>
        </div>

        <div class="ui inverted section divider"></div>
        <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright©2020-2021 AgoBlog Designed by Ago</p>

    </div>
</footer>

<!--这个是在渲染的时候去除掉这一块注释  在页面上不显示-->
<!--Thymeleaf的解析系统将简单地删除<！ - / * /和/ * / - >标记，但不删除包 含其中的内容，因此标记之间的内容将被保留。-->

<!--在thymeleaf(动态)看来  这中间的内容是存在的   但是在html页面元素检索(静态)看来  这个内容是不存在的-->
<!--这就是为什么 虽然这一行被注释掉了，在html页面元素看不到这行代码，但是却能被 th:replace成功的引用到-->
<th:block>
    <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
    <script src="../static/lib/prism/prism.js" th:src="@{/static/lib/prism/prism.js}"></script>
    <script src="../static/lib/tocbot/tocbot.min.js" th:src="@{/static/lib/tocbot/tocbot.min.js}"></script>
    <script src="../static/lib/qrcode/qrcode.min.js" th:src="@{/static/lib/qrcode/qrcode.min.js}"></script>
    <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
    <script src="../static/lib/waypoints/jquery.waypoints.min.js" th:src="@{/static/lib/waypoints/jquery.waypoints.min.js}"></script>
<script>
$("#newblog-container").load(/*[[@{/footer/newblogs}]]*/"footer/newblogs");
</script>
</th:block>

</body>
</html>